package com.ymh.git.thread.juc.goods;

/**
 * Created by aivin on 2018/11/6.
 * 商品的实体类
 */
public class GoodsInfo {

    private final String name;

    private double totalMoney;//总销售额

    private int storeNumber;//总库存数


    public GoodsInfo(String name, double totalMoney, int storeNumber) {
        this.name = name;
        this.totalMoney = totalMoney;
        this.storeNumber = storeNumber;
    }


    public String getName() {
        return name;
    }

    public double getTotalMoney() {
        return totalMoney;
    }

    public int getStoreNumber() {
        return storeNumber;
    }

    /**
     * 修改库存数量的方法
     * @param sellNumber 销售数量
     */
    public void changeNumber(int sellNumber) {
        this.totalMoney += sellNumber * 25;
        this.storeNumber -= sellNumber;

    }
}


